﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>点商后台</title>
    <link href="~/lib/layui/css/layui.css" rel="stylesheet" />
    <script src="~/lib/layui/layui.js"></script>
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body>
    <div class="demoTable">
        <form class="layui-form" onsubmit="return false;">
            姓名：
            <div class="layui-inline">
                <input class="layui-input" name="ShouHuoName" id="ShouHuoName" autocomplete="off">
            </div>
            <button class="layui-btn" data-type="reload" id="a">搜索</button>
        </form>
        <table class="layui-hide" id="test" lay-filter="test"></table>
        <script id="barDemo" type="text/html">
            <a class="layui-btn layui-btn-xs" lay-event="edit">查看</a>
        </script>
    </div>
    <script>
        layui.use(['table', 'layer', 'form'], function () {
            $ = layui.jquery;
            var layer = layui.layer, table = layui.table, form = layui.form;
            table.render({
                elem: '#test'
                , url: '/Customer/Collections/'
                , toolbar: '#toolbarDemo' //开启头部工具栏，并为其绑定左侧模板
                , cols: [[
                    { type: 'checkbox', fixed: 'left' }
                    //, { field: 'Id', hide: true, width: 80, title: 'ID', align: "center" }
                    //, { field: 'OrederId', hide: true, width: 80, title: 'ID', align: "center" }
                    , { field: 'ShouHuoName', width: 100, title: '收货人姓名', align: "center" }
                    , { field: 'Phone', width: 80, title: '手机号', align: "center" }
                    , { field: 'AddRess', width: 80, title: '收货地址', align: "center" }
                    
                ]]
                , page: true
                , id: 'testReload'
            });
            active = {
                reload: function () {
                    table.reload('testReload', {
                        page: {
                            curr: 1
                        }
                        , where: {
                            ShouHuoName: $('#ShouHuoName').val()
                        }
                    }, 'data');
                }
            }

            $('.demoTable #a').on('click', function () {
                var type = $(this).data('type');
                active[type] ? active[type].call(this) : '';
            });
        });

    </script>
</body>
</html>
